#include <iostream>
#include <vector>
#include <time.h>
#include <math.h>
#include "BinarySearchTree.h"
using namespace std;

#define one_second 1000000

void _Sort(vector<int> v_arr,int md)
{
  BinarySearchTree<int>* BST = new BinarySearchTree<int>();
  long double start,end;
  long double dur;
  if(md == 1)
  {
	random_shuffle(v_arr.begin(),v_arr.end());
  }
  start = clock();
  BST->BSTSorting(v_arr,md);
  end = clock();
  dur = (end - start)/one_second;
  cout << dur << "s" << endl;
}

int main()
{
  srand(unsigned(time(NULL)));
  vector<int> arr;
  for(int rank = 1;rank <= 5; rank++)
  {	
  	cout << "Max = " << pow(10,rank) << endl;
  	for(int k = 1; k <= pow(10,rank) ; k++)
   	   arr.push_back(k);
  	_Sort(arr,0);
  	_Sort(arr,1);
  }
};
